<script type="text/javascript">
//表单验证
function formSubmit() {
	//型号
	if($("select[name='mg_type']").val() == ''){
		alert('请选择产品型号');
		return false;
	}
    if(!isempty('mg_name','名称不能为空'))return false;
    if(!isempty('mg_sku','sku不能为空'))return false;
    if(!isempty('mg_price','价格不能为空'))return false;
    if($("input[name=mg_number]").val() <= 0){
        alert('产品数量必须大于0');
        return false;
    }
	return true;
}
</script>


<!--top结束-->
<div class="mian">
	<div class="mian1">
		<div class="mian2">
            <!--left start-->
            <?php $this->load->view('defaults/common/left');?>
            <!--left end-->
			<!--right start-->
			<div class="right">
                <!--breadcrumb start-->
                <div class="righta"><?=$this->breadcrumb->generateHTML();?> </div>
                <!--breadcrumb end-->
				<!-- contents start -->
				<div id="contents">
					<div id="contents_container">
					<form action="<?=blang_url('orders/Iphonebom/'.$post_type)?>" method="post" name="productForm" onsubmit="return formSubmit()" autocomplete="off" >
						<table cellpadding="0" cellspacing="0" id="table_forms" border="1">
						    <tr>
						      <th class="forms_left"><span>*</span>所属型号:</td>
						      <td>
                                  <select name="mg_type"  >
                                      <option value="" >--<?=lang('public_qxz')?>--</option>
                                      <?php foreach ($typeList as $val):?>
                                          <option value="<?=$val?>" <?=$optType[$val]?> >
                                              <?=$val?>
                                          </option>
                                      <?php endforeach;?>
                                  </select>
                              </td>
						    </tr>
						    <tr>
						      <th class="forms_left"><span>*</span>名称:</td>
						      <td><input type="text" name="mg_name" value="<?=$bomFirst['mg_name']?>" /></td>
						    </tr>
                            <tr>
                                <th class="forms_left"><span>*</span>sku:</td>
                                <td><input type="text" name="mg_sku" value="<?=$bomFirst['mg_sku']?>" /></td>
                            </tr>
                            <tr>
                                <th class="forms_left"><span>*</span>价格:</td>
                                <td><input type="text" name="mg_price" value="<?=$bomFirst['mg_price']?>" /></td>
                            </tr>
                            <tr>
                                <th class="forms_left"><span>*</span>数量:</td>
                                <td>
                                    <input type="text" name="mg_number" value="<?=$bomFirst['mg_number']?$bomFirst['mg_number']:1?>" onkeyup="value=value.replace(/[^\d]/g,'')" />
                                    &nbsp;&nbsp; default value (1)
                                </td>
                            </tr>
                            <tr>
                                <th class="forms_left">内存:</td>
                                <td>
                                    <input type="radio" name="mg_memory" value="0"  <?=$ckdMemory[0]?> />无 &nbsp;
                                    <input type="radio" name="mg_memory" value="1"  <?=$ckdMemory[1]?> />16GB &nbsp;
                                    <input type="radio" name="mg_memory" value="2" <?=$ckdMemory[2]?> />32GB&nbsp;
                                    <input type="radio" name="mg_memory" value="3" <?=$ckdMemory[3]?> />64GB
                                </td>
                            </tr>
                            <tr>
                                <th class="forms_left">颜色:</td>
                                <td>
                                    <input type="radio" name="mg_color" value="0"  <?=$ckdColor[0]?> />无 &nbsp;
                                    <input type="radio" name="mg_color" value="1"  <?=$ckdColor[1]?> />金色 &nbsp;
                                    <input type="radio" name="mg_color" value="2" <?=$ckdColor[2]?> />银色&nbsp;
                                    <input type="radio" name="mg_color" value="3" <?=$ckdColor[3]?> />灰色
                                </td>
                            </tr>
                            <tr>
                                <th class="forms_left">是否指纹锁:</td>
                                <td>
                                    <input type="radio" name="mg_lock" value="0"  <?=$ckdLock[0]?> />无 &nbsp;
                                    <input type="radio" name="mg_lock" value="1"  <?=$ckdLock[1]?> />Yes &nbsp;
                                    <input type="radio" name="mg_lock" value="2" <?=$ckdLock[2]?> />No&nbsp;
                                </td>
                            </tr>

                            <tr>
						      <td align="center" colspan="2" class="sub_padding_right">
                                <input type="hidden" name="id" value="<?=$bomFirst['id']?>" />
								<input type="submit" value="<?=lang('public_tj')?>" name="submits" style="margin-right: 20px;width: 150px; height: 30px;"/>
						      </td>
						    </tr>
					   </table>
					</form>
				   </div>
				</div>
				<!-- contents end -->
			</div>
			<!--right end-->
            <div class="clear"></div>
		</div>
	</div>
</div>

